class Money implements Cloneable{
    public double money=12.5;
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
class Student implements Cloneable{
    String name;
    public Money m;
    public Student(String name) {
        this.name = name;
        m=new Money();
    }
    @Override
    protected Object clone() throws CloneNotSupportedException {
//        return super.clone();
        Student tem=(Student) super.clone();
        tem.m=(Money) this.m.clone();
        return tem;
    }
}
public class Clon {
    public static void main(String[] args)throws CloneNotSupportedException {
        Student student1 = new Student("张三");
        Student student2=(Student)student1.clone();
        System.out.println(student1.m.money);
        System.out.println(student2.m.money);
        student2.m.money=99.99;
        System.out.println(student1.m.money);
        System.out.println(student2.m.money);
    }
}
